const config = {
	BASE_URL:"http://10.194.30.172",
	TIMEOUT: 3000
}
export const fetch = (options) => {
	const Token = uni.getStorageSync('Authentication-Token');
	//console.log(options.header['Content-Type'])
	return new Promise((resolve, reject) => {
		uni.request({
			url:config.BASE_URL + options.url,
			method: options.method || 'GET',
			header:{
				'Authentication-Token': Token || ''
			},
			data: options.data || {},
			timeout: config.TIMEOUT,
			success: (res) => {
				resolve(res)
				//console.log(res)
				//return res
			},
			fail: (err) => {
				uni.showToast({
					title:'请求接口失败'
				})
				reject(err)
			}
			
		})
	})
}